package body v8.Class_Handle.Class_Local is

   ------------
   -- Create --
   ------------

   function Create
     (Source         : Pointer;
      Is_Heap_Object : Boolean := True)
      return Local
   is
   begin
      if Is_Heap_Object then
         declare
            function Create_Heap_Object_Handle (Object : Pointer := Source) return Local;
            pragma Import (CPP, Create_Heap_Object_Handle, "_ZN2v811HandleScope12CreateHandleEPNS_8internal10HeapObjectE");
         begin
            return Create_Heap_Object_Handle;
         end;
      else
         declare
            function Create_Local_Object_Handle (Object : Pointer := Source) return Local;
            pragma Import (CPP, Create_Local_Object_Handle, "_ZN2v811HandleScope12CreateHandleEPNS_8internal6ObjectE");
         begin
            return Create_Local_Object_Handle;
         end;
      end if;
   end Create;

end v8.Class_Handle.Class_Local;
